home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / FAQ.SWG / 0042_SEC19-BORLAND.pas < prev    next >
Pascal/Delphi Source File  |  1995-02-28  |  3KB  |  70 lines

  1. SECTION 19 - Protected Mode Programming
  2.                                     
  3. This document contains information that is most often provided
  4. to users of this section.  There is a listing of common
  5. Technical Information Documents that can be downloaded from the
  6. libraries, and a listing of the five most frequently asked
  7. questions and their answers.
  8.  
  9. TI1184   Overview of Borland Pascal 7.0 and Turbo Pascal 7.0
  10. TI1722   Declaring an array on the heap 
  11. TI1760   Creating a  temporary stack in real or protected mode 
  12. TI1188   Creating protected mode apps with Borland Pascal 
  13. TI1171   Problem Report Form 
  14. TI1719   Booting Clean
  15.  
  16. NEWRTM.ZIP   Latest RTM.EXE and DPMI16BI.OVL 
  17. PASALL.ZIP   Collection of Technical Information sheets from 
  18.              1986 on 
  19. EZDPMI.ZIP   Unit encapsulating all common DPMI requirements for 
  20.              protected mode programming
  21. BIGSTU.PAS   How to cope with memory allocations > 64K
  22. MOUSE.ZIP    General Purpose mouse unit for text/graphics mode
  23.  
  24. Q.   "When using the BP7 IDE to compile a protected mode
  25.      application, how do I step through the code like I do with
  26.      real mode applications?"
  27.  
  28. A.   To debug protected mode programs, you must use the external
  29.      debugger (TDX).  You can put it on the TOOLS menu to make
  30.      it just a keystroke away.
  31.  
  32. Q.   "When I convert a program from Real Mode to Protected Mode,
  33.      do I have to change the GetMem calls to GlobalAlloc and
  34.      GlobalDiscard?" 
  35.  
  36. A.   No, you don't have to change the GetMem calls.  GetMem is a
  37.      better allocation method.  Getmem will do a better job of
  38.      allocating memory. It allocates the memory in 8K chunks,
  39.      then suballocates from that. The reason for this is that
  40.      there are a maximum of 2000 selectors availble in BP7, so
  41.      you don't want to waste them. GlobalAlloc calls the DPMI
  42.      directly to allocate the memory, bypassing the heap manager.
  43.      GlobalAlloc is there for when you need to bypass the heap
  44.      manager for some reason, but you normally don't want to do
  45.      that.
  46.  
  47. Q.   "How do I profile a protected mode application using BP7?"
  48.  
  49. A.   You can only profile real mode applications, Borland does
  50.      not supply a protected mode profiler.  
  51.  
  52. Q.   "I have ported a large program to protected mode and am
  53.      getting a General Protection Fault on calls to GetMem.  What
  54.      could be causing this?"
  55.  
  56. A.   In DPMI, a Local Descriptor Table (LDT) can contain 8192
  57.      selectors.  The Run Time Manager (RTM) maintains an
  58.      internal table to track allocated selectors.  The RTM table
  59.      has a capacity of approximately 2K selectors.  GlobalAlloc
  60.      and GetMem calls that need to allocate a new block will fail
  61.      when that 2K table is full.
  62.  
  63. Q.   "I have a protected mode application that was created with
  64.      BP7. When running the program in a DOS box under Windows,
  65.      the computer locks up.  What could be causing this?"
  66.  
  67. A.   Check the "XMS KB Required" and "XMS KB Limit" settings in
  68.      the .PIF file used for the DOS box.  The "Required" setting
  69.      should be 0 and the "Limit" should be at least 2048K.
  70.